// answer to Call For Proposal   
@c1 +cfp(CNPId,Task)[source(A)]
   :  plays(initiator,A) & price(Task,Offer)
   <- +proposal(CNPId,Task,Offer); // remember my proposal
      .send(A,tell,propose(CNPId,Offer)).
	  
@c2 +cfp(CNPId,Task)[source(A)]//if the cfp didn't come from the initiator then
//refuse the cfp.
	: ~plays(initiator,A)
	 <- .send(A,tell,refuse(CNPId)).
	 
@cr1 +accept_proposal(CNPId)
   :  proposal(CNPId,Task,Offer)
   <- .print("My proposal '",Offer,"' won CNP ",CNPId,
             " for ",Task,"!");
			 !Task;
        	  ?plays(initiator,A);
			 .send(A,tell,completed_contract(CNPId)).
      // do the task and report to initiator
      
@cr2 +reject_proposal(CNPId)
   <- .print("I lost CNP ",CNPId, ".");
      -proposal(CNPId,_,_,_). // clear memory
//existing stuff
